import Vue from "vue";
import VueRouter from "vue-router";

Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    redirect: "/dahuan", // 重定向到 '/home'
  },
  {
    path: "/dahuan",
    name: "dahuan",
    component: () =>
      import(/* webpackChunkName: "dahuan" */ "../views/DaHuanView.vue"),
  },
  {
    path: "/haikang",
    name: "haikang",
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () =>
      import(/* webpackChunkName: "haikang" */ "../views/HaiKangView.vue"),
  },
];

const router = new VueRouter({
  // mode: "history",
  mode: "hash",
  base: process.env.BASE_URL,
  routes,
});

export default router;
